package com.knight.service;

import java.util.List;

import com.knight.model.Message;

public class MessageService {
	private static MessageService instance = new MessageService();

	private MessageService() {
	}

	public static MessageService getInstance() {
		return instance;
	}

	private static final Message dao = new Message().dao();

	/**
	 * 保存信息
	 * 
	 * @param message
	 * @return
	 */
	public boolean save(Message message) {
		return message.save();
	}

	/**
	 * 查询状态等于2的留言
	 * 
	 * @return
	 */
	public List<Message> findMessageByStatus() {
		return dao.find("SELECT content,STATUS FROM message WHERE STATUS='2' ORDER BY createDATE");
	}
}
